#pragma comment(linker,"\"/manifestdependency:type='win32' \
name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")

#include "Editor.h"
#include <cassert>


#define BUTTON_ID 1001

class TestEditor : public Editor
{
public:
	//Constructor
	TestEditor(HINSTANCE hInstance);
	//Destructor
	~TestEditor();

	//Framework overrides
	bool Init() override;
	void Update(float dt) override;
	void Render() override;
	LRESULT MsgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) override;

private:
	HWND button;
	HWND borderWindow;
	HWND borderBottom;
	HWND borderRight;
	
	HWND borderWindow2;
	

};

TestEditor::TestEditor( HINSTANCE hInstance ):Editor(hInstance)
{
	button = NULL;
	m_EditorWidth = 1280;
	m_EditorHeight = 720;
}

TestEditor::~TestEditor()
{

}

bool TestEditor::Init()
{
	if(!Editor::Init())
		return false;
	
	return true;
}

void TestEditor::Update( float dt )
{

}

void TestEditor::Render()
{
	assert(m_pDeviceContext);
	assert(m_pSwapChain);

	m_pDeviceContext->ClearRenderTargetView(m_pRenderTargetView,
		reinterpret_cast<const float*>(&d3dColors::CornflowerBlue));

	m_pDeviceContext->ClearDepthStencilView(m_pDepthStencilView, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);

	

	HR(m_pSwapChain->Present(0, 0));
}

LRESULT TestEditor::MsgProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
	switch(msg)
	{

	case WM_DESTROY:
		PostQuitMessage(0);
		return 0;

	case WM_COMMAND:
		switch (LOWORD(wParam))
		{
		case ID_FILE_EXIT:
			PostQuitMessage(0);
			return 0;

		case BUTTON_ID:
			SetWindowText(m_hEditorWindow, "OK!!!!");
			return 0;

		}
		return 0;

	default:
		return DefWindowProc(hwnd, msg, wParam, lParam);
	}
}

int WINAPI WinMain( _In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nShowCmd )
{
	TestEditor editor(hInstance);

	if(!editor.Init())
		return 1;

	return editor.Run();
}